<html>
  <head>
 <script type="text/javascript">
   // the last line read
   var from=0;
 
   $(document).ready(function() {
     poll();
   });
   
   function poll() {
     $.ajax({
       url: "<@s.url value="/log.tail?path=/tmp/harvest/log.txt"/>&from=" + from,
       success: function(html){
         $('#console').append(html);
       },
       complete: function(xmlHttp) {
         from = xmlHttp.getResponseHeader('from');
       }
     });
     
     setTimeout(poll, 2500);   
   }
 </script>   
  </head>
  <body>
    <div class="subMenu">
      <h2>Options</h2>
      <ul>
        <li><@s.a value="/CrawlableResource/detail?key=${crawlableResource.key}">Details</@s.a></li>
        <li><@s.a value="/CrawlableResource/stats?key=${crawlableResource.key}">Harvest stats</@s.a></li>
        <li><@s.a value="/CrawlableResource/admin?key=${crawlableResource.key}">Administer</@s.a></li>
        <li><@s.a value="/CrawlableResource/crawl?key=${crawlableResource.key}">Crawl now</@s.a></li>
      </ul>
      <h2>Harvesting logs:</h2>
      <ul>
        <li><@s.a value="/CrawlableResource/attempt?key=${crawlableResource.key}&attempt=1">Attempt 1: 12:34 26-03-2011</@s.a></li>
      </ul>
    </div>
  
    <div class="subPage">
      <div id="console"></div>
    </div>  
  </body>
</html>